<template>
  <section class="welfare-statistics-main">
    <section class="main-buttons">
      <section class="main-buttons-title">
        <span>余额统计</span>
      </section>
      <section class="main-buttons-btns">
        <el-button style="margin-left: 10px" @click="handleBack">返回</el-button>
      </section>
    </section>

    <section class="main-table">
      <v-table :list="list" :selection="false" tag="accstatistics" :list-loading="listLoading" :cell-style="cellStyle" :filter-column="filtercolumn">
      </v-table>
    </section>
  </section>
</template>
<script>
import { queryPagestat } from './../api'
import VTable from '@/components/Table'
export default {
  name: 'statistics',
  components: { VTable },
  data() {
    return {
      listQuery: {
        page: 1,
        limit: 10,
        subAcntNm: ''
      },
      list: [],
      total: 0,
      listLoading: false
    }
  },
  created() {
    this.getList()
  },
  methods: {
		cellStyle(scope,item){
			
		},
    filtercolumn(scope, item) {
			console.log(item,scope.row[item])
			if(item=='balanceRangeMoney'||item=='balanceRangeCapita'){
				return `<p style="text-align:right;">${scope.row[item]}</p>`
			}else{
				  return scope.row[item]
			}
    },

    handleReset() {
      this.listQuery.subAcntNm = ''
      this.getList()
    },

    handleFilter() {
      this.getList()
    },

    handleBack() {
      this.$router.push({ path:this.$filterPath("index")})
    },

    getList(obj) {
      this.listLoading = true
      return new Promise((resolve, reject) => {
        queryPagestat({
					subAcntTp:this.$route.query.i
				}).then(response => {
          this.list = response.data.data || []
          // this.total = response.data.data.total
          this.listLoading = false
        }).catch(error => {
          reject(error)
          this.listLoading = false
        })
      })
    }
  }
}
</script>
<style lang="scss">
@import '@/styles/mixin.scss';
.welfare-statistics-main {
  padding: 10px;
  .main-search {
    background-color: #fff;
    padding: 0 10px;
    .svg-container {
      padding: 0 5px 0 10px;
      color: #bfced6;
      vertical-align: middle;
      display: inline-block;
    }
    .search-input {
      width: 60%;
      position: relative;
      &:after {
        content: '';
        position: absolute;
        left: -25px;
        right: 0;
        bottom: 8px;
        height: 1px;
        background: rgba(226, 227, 232, 1);
      }
      input {
        outline: none;
        background: transparent;
        border: none;
        outline: medium;
        padding: 0;
        &:focus {
          outline: none;
          background-color: transparent;
        }
      }
    }
    .search-btn {
      display: inline-block;
      float: right;
      .el-button.is-round {
        padding: 10px 30px;
        margin-right: 34px;
      }
      .search-more {
        font-size: 14px;
        font-weight: 500;
        @include font-color($mainColor);
        cursor: pointer;
        margin-left: 10px;
      }
    }

    &.merge {
      height: 50px;
      line-height: 50px;
    }
  }

  .main-buttons {
    display: flex;
    line-height: 36px;
    margin-bottom: 10px;
    .main-buttons-title {
      flex: 1;
      height: 36px;
      line-height: 36px;
      font-size: 16px;
      font-weight: bold;
      color: rgba(51, 51, 51, 1);
      .num {
        @include font-color($mainColor);
      }
    }
  }
}
</style>
